package com.yal.service;

import com.yal.domian.Product;
import com.yal.service.fallback.ProductServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

//fallback指定容错类
@FeignClient(value = "service-product",fallbackFactory = ProductServiceFallbackFactory.class) //value=指定nacos下的服务名称
public interface ProductService {
    //FeignClient的value值+RequestMpping的value值=http://service-product/findByIdForProduct/pid
    @RequestMapping("/findByIdForProduct/{pid}")//指定请求url部分
    Product findByPid(@PathVariable Integer pid);

}
